
<% content_for :main_div do %>
  <div>
<% end %>
    <div class="password-reset-new">
        <div class="new-form">
            <div class="form-header">
              <h3>重置密码</h3>
            </div>
            <div class="form-content " id="app">
                <vue-form :state="formstate" v-model="formstate" @submit.prevent="onSubmit" action="/password_reset" method="post">
                    <div class="row margin-reset">
                      <%= flash_messages %>
                      <div class="form-group">
                          <validate auto-label class="form-group required-field" :class="fieldClassName(formstate.name)">
                            <div class="col-xs-8 padding-reset">
                              <i class="fa fa-phone input-icon"></i>
                              <input type="text" name="user[mobile]" class="form-control private-input" required v-model.lazy="cellphone" placeholder="您的手机号码" aria-describedby="phone" cellphone-validator>
                            </div>
                            <div class="col-xs-4 padding-reset">
                              <cellphone-code type="reset"></cellphone-code>
                            </div>

                            <field-messages name="user[mobile]" show="$touched || $submitted" class="col-xs-12 padding-reset error" style="margin-bottom: 10px;">
                              <div slot="required">请输入手机号</div>
                              <div slot="cellphone-validator">请输入正确的手机号</div>
                            </field-messages>
                          </validate>
                      </div>
                    </div>

                    <div class="form-group">
                      <validate auto-label class="form-group required-field" :class="fieldClassName(formstate.name)">
                        <i class="fa fa-envelope-o input-icon"></i>
                        <input type="text" name="user[sms_code]" class="form-control private-input" required v-model.lazy="model.smsCode" placeholder="验证码">

                        <field-messages auto-label name="user[sms_code]" show="$touched || $submitted" class="error">
                          <div slot="required">请输入短信验证码</div>
                        </field-messages>

                      </validate>
                    </div>

                    <div class="form-group">
                      <validate auto-label class="form-group required-field" :class="fieldClassName(formstate.name)">
                        <i class="fa fa-unlock-alt input-icon"></i>
                        <input type="password" name="user[password]" class="form-control private-input" required v-model.lazy="model.password" minlength="6" placeholder="密码">

                        <field-messages auto-label name="user[password]" show="$touched || $submitted" class="error">
                          <div slot="required">请输入密码</div>
                          <div slot="minlength">密码至少6位</div>
                        </field-messages>
                      </validate>
                    </div>

                    <div class="form-group">
                      <validate auto-label class="form-group required-field" :class="fieldClassName(formstate.name)"  :custom="{passwordConfirmationValidator: passwordConfirmationValidator}">
                        <i class="fa fa-unlock-alt input-icon"></i>
                        <input type="password" name="user[password_confirmation]" class="form-control private-input" required v-model.lazy="model.passwordConfirmation" placeholder="确认密码">

                        <field-messages auto-label name="user[password_confirmation]" show="$touched || $submitted" class="error">
                          <div slot="required">请再次输入密码</div>
                          <div slot="passwordConfirmationValidator">请确认两次密码输入一致</div>
                        </field-messages>
                      </validate>
                    </div>

                    <div class="form-group">
                        <% unless params[:invite_token].blank? %>
                          <%= f.hidden_field :sys_invite_token, :value => params[:invite_token] %>
                        <% end %>
                        <%= hidden_field_tag :authenticity_token, form_authenticity_token -%>
                        <button class="btn btn-primary private-btn btn-block">提&nbsp;&nbsp;&nbsp;&nbsp;交</button>
                    </div>

                    <div class="form-group form-links">
                      <a href="/sign_in">登录账号</a>
                      <a href="/sign_up">免费注册</a>
                    </div>
                </div>
                </vue-form>
            <!-- <div class="form-content " id="app">
                <%= simple_form_for(@user, :url => password_reset_path, :method => 'POST', :html => {:class => 'home-from simple-form'}, :validate => true) do |f| %>

                <div class="row margin-reset form-group" id="app">
                  <div class="col-xs-8 padding-reset">
                    <i class="fa fa-phone input-icon"></i>
                    <%= f.input :sms_code, :input_html => {:uniq => false, :id => 'user_sms_code', :class => 'form-control private-input'}, :placeholder => '您收到的短信验证码', :label => false %>
                  </div>
                  <div class="col-xs-4 padding-reset">
                    <cellphone-code type="uniq"></cellphone-code>
                  </div>
                </div>

                <div class="form-group">
                    <i class="fa fa-unlock-alt input-icon"></i>
                    <%= f.input_field :password, :confirm_validate => true, :error_message => '请确保重复密码与密码相匹配', :placeholder => '请输入至少六位的新密码', :label => false, class: 'form-control private-input', validate: true %>
                </div>

                <div class="form-group">
                    <i class="fa fa-unlock-alt input-icon"></i>
                    <%= f.input_field :password_confirmation, :placeholder => '请重复您输入的密码', :label => false, class: 'form-control private-input' %>
                </div>

                <div class="form-group">
                    <% unless params[:invite_token].blank? %>
                      <%= f.hidden_field :sys_invite_token, :value => params[:invite_token] %>
                    <% end %>
                    <%= hidden_field_tag :authenticity_token, form_authenticity_token -%>
                    <button class="btn btn-primary private-btn btn-block">提&nbsp;&nbsp;&nbsp;&nbsp;交</button>
                </div>

                <div class="form-group form-links">
                  <a href="/sign_in">登录账号</a>
                  <a href="/sign_up">免费注册</a>
                </div>
            </div>
            <% end %> -->
        </div>
    </div>
</div>
